package com.example.service.impl;

import com.example.dao.CollectionDao;
import com.example.entity.GoodsCollectionDTO;
import com.example.entity.UserCollection;
import com.example.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Date;
import java.util.List;

@Service
public class CollectionServiceImpl implements CollectionService {

    @Autowired
    private CollectionDao collectionDao;

    @Override
    public boolean addCollection(int uid, int gid, String time) {
        return collectionDao.addCollection(uid, gid,time) > 0;
    }

    @Override
    public List<GoodsCollectionDTO> getUserCollections(int uid) {
        return collectionDao.getUserCollections(uid);
    }

    @Override
    public boolean remove(int collectionid) {
        return collectionDao.remove(collectionid)>0;
    }
}